import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
	routes: [
		{
			path: '/',
			redirect: '/dashboard',
		},
		{
			path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
			children: [
				{
					path: '/dashboard',
                    component: resolve => require(['../page/dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
				},
				{
					path: '/systemManage',
                    component: resolve => require(['../page/routine/systemManage.vue'], resolve),
                    meta: { title: '系统配置' }
				},
				{
					path: '/filesManage',
                    component: resolve => require(['../page/routine/filesManage.vue'], resolve),
                    meta: { title: '文件管理' }
				},
				{
					path: '/personalManage',
                    component: resolve => require(['../page/routine/personalManage.vue'], resolve),
                    meta: { title: '个人管理' }
				},
				{
					path: '/columnManage',
                    component: resolve => require(['../page/columnManage/columnManage.vue'], resolve),
                    meta: { title: '栏目管理' }
				},
				{
					path: '/roleManage',
                    component: resolve => require(['../page/power/roleManage.vue'], resolve),
                    meta: { title: '角色管理' }
				},
				{
					path: '/userManage',
                    component: resolve => require(['../page/power/userManage.vue'], resolve),
                    meta: { title: '用户管理' }
				},
				{
					path: '/menuManage',
                    component: resolve => require(['../page/power/menuManage.vue'], resolve),
                    meta: { title: '菜单管理' }
				},
				{
					path: '/messManage',
                    component: resolve => require(['../page/message/messManage.vue'], resolve),
                    meta: { title: '短信' }
				},
				{
					path: '/productClass',
                    component: resolve => require(['../page/productsColumn/productClass.vue'], resolve),
                    meta: { title: '产品分类' }
				},
				{
					path: '/productContent',
                    component: resolve => require(['../page/productsColumn/productContent.vue'], resolve),
                    meta: { title: '产品内容' }
				},
			]
		},
        {
            path: '/404',
            component: resolve => require(['../page/status/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../page/status/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
	]
})
